import instance from '@/utils/request'
// 封装注册请求
export const register = (data) => { 
   return instance.post('user/registered',data)
}
// 封装登录请求
export const login = (data) => { 
  return instance.post('user/login',data)
}
export const swiper = () => { 
  return instance.get('home/swiper')
}
export const groups = () => { 
  return instance.get('home/groups?area=AREA%7C88cff55c-aaa4-e2e0')
}
export const favorites = () => { 
  return instance.get('user/favorites')
}
export const hot = () => { 
  return instance.get('area/hot')
}
// 封装获取登录user的信息
export const userInformation = () => { 
  return instance.get('user')
}
// 封装获取房子的信息
// export const houseList = (id) => { 
//   return instance.get('houses?cityId=AREA%7C88cff55c-aaa4-e2e0&area=AREA%7C88cff55c-aaa4-e2e0&rentType=true&price=null&more=CHAR%7C76eb0532-8099-d1f4%2CFLOOR%7C1%2CAREA%7C88cff55c-aaa4-e2e0%2CORIEN%7C61e99445-e95e-7f37%2Ctrue&roomType=ROOM%7Cd1a00384-5801-d5cd&oriented=ORIEN%7C61e99445-e95e-7f37&characteristic=CHAR%7C76eb0532-8099-d1f4&floor=FLOOR%7C1&start=1&end=20', {cityId:id})
// }
export const houseList = () => { 
  return instance.get('houses')
}

// 封装获取城市列表
export const citys = () => { 
  return instance.get('area/city?level=1')
}

// 封装获取城市房子套数的数据
export const areaMaps = (id) => { 
  return instance.get('area/map', { params: {id} })
}